import { createRouter, createWebHashHistory } from "vue-router";

const routes = [{
        path: '/home',
        component: () =>
            import ('../pages/Home.vue')
    },
    {
        path: '/Audio',
        component: () =>
            import ('../pages/AudioRecognition.vue')
    },
    {
        path: '/Video',
        component: () =>
            import ('../pages/FaceRecognition.vue')
    },
    {
        path: '/voicedb',
        component: () =>
            import ('../pages/VoiceDB.vue'),
        children: [{
                path: '',
                component: () =>
                    import ('../pages/VoicedbDetial/VoiceShow.vue'),
            },
            {
                path: 'voiceupload',
                component: () =>
                    import ('../pages/VoicedbDetial/VoiceUpload.vue'),
            },
            {
                path: 'voicecompare',
                component: () =>
                    import ('../pages/VoicedbDetial/VoiceCompare.vue'),
            },
            {
                path: 'voicesearch',
                component: () =>
                    import ('../pages/VoicedbDetial/VoiceSearch.vue'),
            }
        ]
    },
    {
        path: '/facedb',
        component: () =>
            import ('../pages/FaceDB.vue'),
        children: [{
                path: '',
                component: () =>
                    import ('../pages/FacedbDetial/FaceShow.vue'),
            },
            {
                path: 'faceupload',
                component: () =>
                    import ('../pages/FacedbDetial/FaceUpload.vue'),
            },
            {
                path: 'facecompare',
                component: () =>
                    import ('../pages/FacedbDetial/FaceCompare.vue'),
            },
            {
                path: 'facesearch',
                component: () =>
                    import ('../pages/FacedbDetial/FaceSearch.vue'),
            }
        ]
    },
    {
        path: '/dataanalysis',
        component: () =>
            import ('../pages/DataAnalysis.vue'),
        children: [{
                path: '',
                component: () =>
                    import ('../pages/DataAnalysisDetial/ChartShow.vue'),
            },
            {
                path: 'adddata',
                component: () =>
                    import ('../pages/DataAnalysisDetial/AddData.vue'),
            },
            {
                path: 'editdata',
                component: () =>
                    import ('../pages/DataAnalysisDetial/EditData.vue'),
            },
            {
                path: 'editdata2',
                component: () =>
                    import ('../pages/DataAnalysisDetial/EditData2.vue'),
            },
        ]
    },
    {
        path: '/Test',
        component: () =>
            import ('../pages/Test.vue')
    },
    {
        path: '/Rtsp',
        component: () =>
            import ('../pages/Rtsp.vue')
    },
]

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})

export default router;